grails.gorm.default.mapping = {
    cache true
}
grails.gorm.default.constraints = {
    '*'(nullable: true)
}
grails.gorm.failOnError = true

//grails.plugin.springsecurity.rest.token.storage.useGorm = false
//grails.plugin.springsecurity.rest.token.storage.gorm.tokenDomainClassName = 'middol.auth.AuthenticationToken'
//grails.plugin.springsecurity.rest.token.storage.useRedis = true
grails.plugin.springsecurity.rest.token.storage.redis.expiration = 3600
grails.plugin.springsecurity.rest.token.storage.jwt.secret = "qrD6h8K6S9503Q06Y6Rfk21TErImPYqa"

// Added by the Spring Security Core plugin:
grails.plugin.springsecurity.userLookup.userDomainClassName = 'middol.auth.User'
grails.plugin.springsecurity.userLookup.authorityJoinClassName = 'middol.auth.UserAuthority'
grails.plugin.springsecurity.authority.className = 'middol.auth.Authority'
grails.plugin.springsecurity.requestMap.className = 'middol.auth.Requestmap'
grails.plugin.springsecurity.securityConfigType = 'Requestmap'
grails.plugin.springsecurity.controllerAnnotations.staticRules = [
	[pattern: '/',               access: ['permitAll']],
	[pattern: '/error',          access: ['permitAll']],
	[pattern: '/index',          access: ['permitAll']],
	[pattern: '/index.gsp',      access: ['permitAll']],
	[pattern: '/shutdown',       access: ['permitAll']],
	[pattern: '/assets/**',      access: ['permitAll']],
	[pattern: '/**/js/**',       access: ['permitAll']],
	[pattern: '/**/css/**',      access: ['permitAll']],
	[pattern: '/**/images/**',   access: ['permitAll']],
	[pattern: '/**/favicon.ico', access: ['permitAll']]
]

grails.plugin.springsecurity.filterChain.chainMap = [
	[pattern: '/assets/**',      filters: 'none'],
	[pattern: '/**/js/**',       filters: 'none'],
	[pattern: '/**/css/**',      filters: 'none'],
	[pattern: '/**/images/**',   filters: 'none'],
	[pattern: '/**/favicon.ico', filters: 'none'],
	[pattern: '/api/**', filters: 'JOINED_FILTERS,-anonymousAuthenticationFilter,-exceptionTranslationFilter,-authenticationProcessingFilter,-securityContextPersistenceFilter'],
	[pattern: '/**',             filters: 'JOINED_FILTERS,-restTokenValidationFilter,-restExceptionTranslationFilter']
]

// Added by the Audit-Logging plugin:
grails {
	plugin {
		auditLog {
			auditDomainClassName = 'middol.logs.OperationLog'
			verbose = true
			failOnError = true
			excluded = ['version', 'lastUpdated', 'lastUpdatedBy', 'createdBy', 'dateCreated']
			mask = ['password']
			logIds = true
			stampEnabled = true
//			ignoreEvents = [grails.plugins.orm.auditable.AuditEventType.INSERT]
			verboseEvents = [middolauditlog.AuditEventType.UPDATE, middolauditlog.AuditEventType.INSERT, middolauditlog.AuditEventType.DELETE]
//			verboseEvents = [[enumType: "grails.plugins.orm.auditable.AuditEventType",name: "UPDATE"], [enumType: "grails.plugins.orm.auditable.AuditEventType",name: "DELETE"]]
		}
	}
}

